package net.scrumtool.model;

// Generated 27 mars 2014 09:47:30 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Event generated by hbm2java
 */
@Entity
@Table(name = "event"
		, catalog = "scrumtool")
public class Event implements java.io.Serializable {

	private Integer id;
	private Sprint sprint;
	private Eventtype eventtype;
	private Date eventDate;

	public Event() {
	}

	public Event(Sprint sprint, Eventtype eventtype) {
		this.sprint = sprint;
		this.eventtype = eventtype;
	}

	public Event(Sprint sprint, Eventtype eventtype, Date eventDate) {
		this.sprint = sprint;
		this.eventtype = eventtype;
		this.eventDate = eventDate;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idSprint", nullable = false)
	public Sprint getSprint() {
		return this.sprint;
	}

	public void setSprint(Sprint sprint) {
		this.sprint = sprint;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idEventType", nullable = false)
	public Eventtype getEventtype() {
		return this.eventtype;
	}

	public void setEventtype(Eventtype eventtype) {
		this.eventtype = eventtype;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "eventDate", length = 10)
	public Date getEventDate() {
		return this.eventDate;
	}

	public void setEventDate(Date eventDate) {
		this.eventDate = eventDate;
	}

}
